
import { _decorator, Component, Node,Prefab, instantiate,director } from 'cc';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = GameManager
 * DateTime = Wed Apr 13 2022 23:05:07 GMT+0800 (中国标准时间)
 * Author = xiaopang125
 * FileBasename = GameManager.ts
 * FileBasenameNoExtension = GameManager
 * URL = db://assets/GameManager.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */
 
@ccclass('GameManager')
export class GameManager extends Component {
    // [1]
    // dummy = '';
   
    // [2]
    // @property
    // serializableDummy = 0;
    @property({type: Prefab})
    public coinPrfb: Prefab | null = null;

    start () {
        // let coin:Node;
        // [3]
        const coin=instantiate(this.coinPrfb);
        coin.parent = director.getScene();
        coin.setPosition(0,200);
    }

    // update (deltaTime: number) {
    //     // [4]
    // }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/decorator.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
